package com.cc.model.convert

import com.cc.model.Script
import com.cc.model.dto.ScriptDto
import org.mapstruct.*

@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE, componentModel = MappingConstants.ComponentModel.SPRING)
abstract class ScriptConvert {

    abstract fun toEntity(scriptDto: ScriptDto): Script

    abstract fun toDto(script: Script): ScriptDto

    @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
    abstract fun partialUpdate(scriptDto: ScriptDto, @MappingTarget script: Script): Script
}